/////////////////////////////////////////////////////////////////////////////
// Name:        dgt_PluginGrid.cpp
// Purpose:     
// Author:      Aleksey Plotnikov & Alla Nabatova
// Modified by: 
// Created:     19/03/2008 22:57:44
// RCS-ID:      
// Copyright:   Diamant Software
// Licence:     
/////////////////////////////////////////////////////////////////////////////



#include "dgt_PluginGrid.h"

BEGIN_EVENT_TABLE (dgt_PluginGrid, wxGrid)
EVT_PAINT (dgt_PluginGrid::OnPaint)
END_EVENT_TABLE ()

/**********************************************************************************************/
dgt_PluginGrid::dgt_PluginGrid(void)
{
}
/**********************************************************************************************/
dgt_PluginGrid::~dgt_PluginGrid(void)
{
}
/**********************************************************************************************/


dgt_PluginGrid::dgt_PluginGrid(wxWindow* parent, 
				   wxWindowID id, const wxPoint& pos, 
				   const wxSize& size, 
				   long style, 
				   const wxString& name)
				   : wxGrid (parent, id, pos, size, style, name)
{
	
}
/***********************************************************************************************/
void dgt_PluginGrid::OnPaint(wxPaintEvent& event)
{
	wxPaintDC dc(this);

	dc.DrawLine(0,0,300,250);
	//dc.DrawText(_T("asdfasd"), 0,0); 
	event.Skip();
}
/**********************************************************************************************/
//sets labels and create wxChoice in cells
void dgt_PluginGrid::SetGridMode()
{
	SetColSize(2, 325);
	SetColSize(0, 100);
//	SetC
	SetColLabelValue(0, _T("File"));
	SetColLabelValue(1, _T("Active"));
	SetColLabelValue(2, _T("Name"));
	SetColLabelValue(3, _T("Version"));


}
void dgt_PluginGrid::SetGridSize()
{
	/*wxString str;
	unsigned max=0;
	unsigned len=0;
	for (int i=0; i<plugin_count; i++)
	{
		str = this->GetCellValue(i,1);
		len = str.Len();
		if (len>max) max = len;
	}*/
	
}
void dgt_PluginGrid::SetCheckBox(unsigned ColNum)
{
	wxGridCellAttr* pAttr = new wxGridCellAttr();
	pAttr->SetRenderer( new wxGridCellBoolRenderer() );
	pAttr->SetEditor( new wxGridCellBoolEditor() );
	pAttr->SetAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
	this->SetColAttr( ColNum, pAttr );
}

